var courseNames; 
    
$(function () 
{
	//immediately retrieve the course information
	$.post("/getCourse", function(data) 
	{
		$("#categoriesSelect").hide();
    	alert("passing courses along");
        courseNames = data; //store in courseNames
        courseLength = courseNames.Object.length; //check this call later
        
        //make sure that there are courses available to add into
        if (courseLength == 0) 
        	$("#coursesSelect").append("<option value=index>No Courses Available</option>");	
        else        
        	jQuery.each(courseNames, function(index, val) 
        	{        	
        		//sketchy iteration, verify syntax
        		$("#coursesSelect").append("<option value=index>" + val + "</option>");	
        	});
        alert("success" + success);                      
    });
            
	$.post("/getCourse", function(data) {
    	alert("passing data along");
        courseNames = data;
    });        	      
});